// Function to read in a file from disk
// Copyright 2005 (C) Ralph Thomas

#include <util/readFile.h>
#include <boost/filesystem/fstream.hpp>

namespace util {
	std::string readFile( const boost::filesystem::path& name ) {
		boost::filesystem::ifstream file( name, std::ios_base::in | std::ios_base::binary );
		std::string contents;

		while( !file.eof() ) {
			std::ifstream::char_type c( 0 );
			file.get( c );
			if( !file.eof() ) contents += c;
		}
		return contents;
	}
};

